# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=doxygen
pkgver=1.9.4
pkgrel=0
pkgdesc="A documentation system for C++, C, Java, IDL and PHP"
url="https://www.doxygen.nl/"
arch="all"
license="GPL-2.0-or-later"
checkdepends="libxml2-utils"
makedepends="flex bison coreutils perl python3 cmake samurai"
source="https://doxygen.nl/files/doxygen-$pkgver.src.tar.gz
	"

[ "$CARCH" = "riscv64" ] && options="textrels"

build() {
	cmake -B build -G Ninja \
		-DGIT_EXECUTABLE=/bin/false \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-Dbuild_xmlparser=ON .
	cmake --build build
}

check() {
	# Remove test that use bibtex
	rm -f ./testing/012_cite.dox
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
613f17800ebd05b66b1954af4d51282a1779678e7ade6c43046fc940742a697ebdf3af8e94ac70a3422bc96def663e70eaea8c4349d192e2fe5e516c57cc345a  doxygen-1.9.4.src.tar.gz
"
